<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->string('order_no')->primary()->comment('订单号');
            $table->integer('sale_user_id')->comment('卖方用户ID');
            $table->integer('buy_user_id')->comment('买方用户ID');
            $table->integer('auction_id')->comment('拍卖ID');
            $table->integer('product_id')->comment('商品ID');
            $table->decimal('amount')->comment('金额');
            $table->decimal('integral')->comment('积分');
            $table->string('voucher')->default('')->comment('付款凭证');
            $table->boolean('status')->default(0)->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
